home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / ctlib100.zip / INSTALL.LZH / CTQUEUES.INT < prev    next >
Text File  |  1996-10-12  |  2KB  |  51 lines

  1. {**************************************************************************}
  2. {*  BitSoft Development, L.L.C.                                           *}
  3. {*  Copyright (C) 1995, 1996 BitSoft Development, L.L.C.                  *}
  4. {*  All rights reserved.                                                  *}
  5. {*  Queue objects unit                                                    *}
  6. {*  Version 1.0.7                                                         *}
  7. {**************************************************************************}
  8.  
  9. unit ctQueues;
  10.  
  11. {$X+}
  12.  
  13. interface
  14.  
  15. uses Objects,
  16.      Containr, ctLists, ctTypes;
  17.  
  18. type
  19.   PQueue = ^TQueue;
  20.   TQueue = object(TList)
  21.     function Enqueue (Item : Pointer) : Boolean; virtual;
  22.     function Front : PListNode; virtual;
  23.     function Rear : PListNode; virtual;
  24.     function Remove : Pointer; virtual;
  25.   end;  { TQueue }
  26.  
  27. type
  28.   PDoubleEndedQueue = ^TDoubleEndedQueue;
  29.   TDoubleEndedQueue = object(TQueue)
  30.     function RemoveFirst : Pointer; virtual;
  31.     function RemoveLast : Pointer; virtual;
  32.   end;  { TDoubleEndedQueue }
  33.  
  34. procedure RegisterQueues;
  35.  
  36. const
  37.   RQueue : TStreamRec = (
  38.     ObjType : idQueue;
  39.     VmtLink : Ofs(TypeOf(TQueue)^);
  40.     Load    : @TQueue.Load;
  41.     Store   : @TQueue.Store);
  42.  
  43.   RDoubleEndedQueue : TStreamRec = (
  44.     ObjType : idDoubleEndedQueue;
  45.     VmtLink : Ofs(TypeOf(TDoubleEndedQueue)^);
  46.     Load    : @TDoubleEndedQueue.Load;
  47.     Store   : @TDoubleEndedQueue.Store);
  48.  
  49. implementation
  50. end.
  51.